package com.itheima;

import com.itheima.domain.Account;
import com.itheima.service.AccountService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
// 声明 Spring 的配置文件
@ContextConfiguration(classes = SpringConfig.class)
public class JUnitTest {
    @Autowired
    private AccountService accountService;
@Test
    public void test(){
    Account byid = accountService.findByid(1);
    System.out.println(byid);
}
}
